package com.wuhanpe.leafid.logger

import com.p6spy.engine.event.JdbcEventListener
import com.p6spy.engine.logging.P6LogOptions
import com.p6spy.engine.spy.P6Factory
import com.p6spy.engine.spy.P6LoadableOptions
import com.p6spy.engine.spy.option.P6OptionsRepository

/**
 * @author zooy
 * @since 2025/9/12-14:39
 */
class MybatisPlusLogFactory: P6Factory {

    override fun getOptions(optionsRepository: P6OptionsRepository?): P6LoadableOptions {
        return P6LogOptions(optionsRepository)
    }

    override fun getJdbcEventListener(): JdbcEventListener {
        return MybatisPlusLoggingEventListener.getInstance()
    }
}
